package com.lagou;

import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.data.Stat;

/**
 * @author: jie.zhao
 * @create: 2021/06/01 14:02
 */
public class ZookeeperUpdateNode {

    public String updateNode(ZooKeeper zooKeeper, String data, String path) throws KeeperException, InterruptedException {

        Stat node = zooKeeper.setData(path, data.getBytes(),-1);
        return node.toString();
    }
}
